-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix(server): handle INFO command with multiple sections correctly #6093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(server): handle INFO command with multiple sections correctly #6093
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the INFO command to support multiple sections, removing the syntax error that occurred when more than one section was requested. The implementation now accepts multiple section arguments and concatenates their outputs, ignoring invalid section names to match Redis behavior.
Key Changes:
- Removed the syntax error check that limited INFO to single section requests
- Added logic to parse and process multiple sections, with optimization to avoid expensive metrics collection when only SERVER or REPLICATION sections are requested
- Added tests for multiple valid sections and mixed valid/invalid sections
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/server/server_family.cc | Modified Info() command to support multiple sections, refactored metrics fetching logic to handle multiple section requests efficiently, and added concatenation of multiple section outputs |
| src/server/server_family_test.cc | Added tests for multiple valid sections (InfoMultipleSections) and mixed valid/invalid sections (InfoMultipleSectionsInvalid) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix INFO command to support multiple sections, resolving syntax errors when more than one section is requested. Valid sections are returned, while invalid ones are ignored, matching Redis server behavior. Adds tests for positive and negative multi-section cases. Improves code clarity and ensures metrics are fetched efficiently for relevant sections. Signed-off-by: Gil Levkovich <[email protected]>
d59cdbe to
68724fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gil Levkovich <[email protected]>
935b48f to
872888f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix INFO command to support multiple sections, resolving syntax errors when more than one section is requested. Valid sections are returned, while invalid ones are ignored, matching Valkey server behaviour.
Adds tests for positive and negative multi-section cases. Improves code clarity and ensures metrics are fetched efficiently for relevant sections.